
var musiceSourceObject = require('./plugins/kuwo.js');
async function getList(){



var musicList = await  musiceSourceObject.getRecommendSheetsByTag("",1);

// console.log(JSON.stringify(musicList))
return musicList;
}
async function getMusicListDetail(id){


var musicList = await  musiceSourceObject.getMusicSheetInfo(id);
// console.log("列表:",JSON.stringify(musicList))
console.log('\r\n');
return musicList.musicList;
}


async function getMusicUrl(item){

// console.log('\r\n',item.m);

var musicInfo = await  musiceSourceObject.getMediaSource(item);
console.log("结果:",JSON.stringify(musicInfo))


}
// fetch("https://y.0msl.com/", {
//   "headers": {
//     "accept": "application/json",
//     "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
//     "x-requested-with": "XMLHttpRequest",
//   },
//   "body": "input=%E7%A7%8B%E5%A4%A9&filter=name&type=qq&page=1",
//   "method": "POST"
// }).then( async (v)=> {
//     console.log(await v.json())
// })

// fetch("https://api.qqmp3.vip/api/kw.php?rid=11&type=json&level=exhigh&lrc=true", {
//   "headers": {
//     "accept": "*/*",
//     "accept-language": "zh-CN,zh;q=0.9",
//     "cache-control": "no-cache",
//     "pragma": "no-cache",
//     "priority": "u=1, i",
//     "sec-ch-ua": "\"Not;A=Brand\";v=\"99\", \"Google Chrome\";v=\"139\", \"Chromium\";v=\"139\"",
//     "sec-ch-ua-mobile": "?0",
//     "sec-ch-ua-platform": "\"Android\"",
//     "sec-fetch-dest": "empty",
//     "sec-fetch-mode": "cors",
//     "sec-fetch-site": "same-site",
//     "Referer": "https://www.qqmp3.vip/"
//   },
//   "body": null,
//   "method": "GET"
// }).then(async (v)=>{
//   console.log(await v.json())
// })


getList().then((v)=>{
  //  console.log(v.data)
   
    getMusicListDetail(v.data[0]).then((v)=>{
        console.log(v)
        getMusicUrl(v[0])
    })
})

//getMusicList();
